package com.zhuge_new.Adapter;

import android.app.Activity;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhuge_new.R;
import com.zhuge_new.bean.RedDisolayBean;
import com.zhuge_new.bean.RedShowBean;
import com.zhuge_new.share.BaseHttp;

import java.util.List;

/**
 * Created by lenovo on 2018-09-20.
 */

public class RedMoneyimgAdapter extends RecyclerView.Adapter<RedMoneyimgAdapter.ViewHolder>{

    private Context context;
    private RedDisolayBean redDisolayBean;
    public RedMoneyimgAdapter(Context context, RedDisolayBean redDisolayBean) {
        this.context=context;
        this.redDisolayBean=redDisolayBean;
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view=View.inflate(context,R.layout.item_imared,null);
        ViewHolder viewHolder=new ViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
        String url=redDisolayBean.getObject().getPicturesList().get(position);
        Glide.with(context).load(BaseHttp.baseImg1+url).into(holder.iv_red);
    }


    @Override
    public int getItemCount() {
        return redDisolayBean.getObject().getPicturesList().size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        private ImageView iv_red;

        public ViewHolder(View itemView) {
            super(itemView);
            iv_red = itemView.findViewById(R.id.iv_imared);
        }
    }
}
